/*
 * @Author: taoyuqing
 * @Date: 2023-01-10 02:19:17
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:spree/utils/utils.dart';
import 'package:spree/widgets/vip_rectangle_box.dart';

class Fait extends StatefulWidget {
  Fait({Key? key}) : super(key: key);

  @override
  State<Fait> createState() => _FaitState();
}

class _FaitState extends State<Fait> {
  List _depositAmounts = [
    {'number': 20},
    {'number': 50},
    {'number': 100},
    {'number': 150},
    {'number': 250},
    {'number': 500}
  ];
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            'Fait',
            style: TextStyle(
                color: Colors.white, fontSize: 16, fontWeight: FontWeight.w800),
          ),
          Container(
              margin: EdgeInsets.only(top: 10),
              child: Row(
                children: [
                  Text(
                    'Currency:',
                    style: TextStyle(
                        color: Colors.white,
                        fontSize: 14,
                        fontWeight: FontWeight.w700),
                  ),
                  VipRectangleBox(
                    margin: EdgeInsets.only(left: 20),
                    padding:
                        EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
                    color: Color(0xFF29205F),
                    child: Text(
                      'TRC20',
                      style: TextStyle(
                          color: Color(0xFFFFED4A),
                          fontWeight: FontWeight.w700),
                    ),
                  ),
                  VipRectangleBox(
                    margin: EdgeInsets.only(left: 20),
                    padding:
                        EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
                    color: Color(0xFF29205F),
                    child: Text(
                      'PIX',
                      style: TextStyle(
                          color: Color(0xFFFFED4A),
                          fontWeight: FontWeight.w700),
                    ),
                  ),
                  VipRectangleBox(
                    margin: EdgeInsets.only(left: 20),
                    padding:
                        EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
                    color: Color(0xFF29205F),
                    child: Text(
                      'PICPAY',
                      style: TextStyle(
                          color: Color(0xFFFFED4A),
                          fontWeight: FontWeight.w700),
                    ),
                  ),
                ],
              )),
          VipRectangleBox(
            margin: EdgeInsets.only(top: 20),
            alignment: Alignment.centerLeft,
            height: 50,
            color: Color(0xFF29205F),
            child: Row(
              children: [
                Text(
                  'R\$  ',
                  style: TextStyle(
                      color: Color(0xFFFFED4A), fontWeight: FontWeight.w800),
                ),
                Text(
                  'BRL',
                  style: TextStyle(
                      color: Colors.white, fontWeight: FontWeight.w800),
                )
              ],
            ),
          ),
          VipRectangleBox(
            margin: EdgeInsets.only(top: 20),
            alignment: Alignment.centerLeft,
            height: 50,
            color: Color(0xFF29205F),
            child: Row(
              children: [
                Text(
                  'R\$  ',
                  style: TextStyle(
                      color: Color(0xFFFFED4A), fontWeight: FontWeight.w800),
                ),
                Text(
                  '1000',
                  style: TextStyle(
                      color: Colors.white, fontWeight: FontWeight.w800),
                )
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 20),
            child: Wrap(
              spacing: 10,
              runSpacing: 10,
              children: _depositAmount(_depositAmounts),
            ),
          ),
          Container(
            width: Utils().getScreenWidth(context),
            height: 40,
            margin: EdgeInsets.only(top: 10),
            child: ElevatedButton(
                style: ButtonStyle(
                  backgroundColor: MaterialStateProperty.all(Color(0xFF685BB1)),
                ),
                onPressed: () {},
                child: Text('Buy')),
          )
        ],
      ),
    );
  }

  List<Widget> _depositAmount(List list) {
    return list.map((e) {
      return VipRectangleBox(
        width: 100,
        padding: EdgeInsets.only(top: 5, bottom: 6),
        color: Color(0xFF29205F),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text('R\$  ',
                style: TextStyle(
                    color: Colors.white, fontWeight: FontWeight.w800)),
            Text('${e['number']}',
                style: TextStyle(
                  color: Colors.white,
                ))
          ],
        ),
      );
    }).toList();
  }
}
